package com.hzlh.service.impl;

import com.hzlh.dao.TCompanyProductDao;
import com.hzlh.model.TCompanyProduct;
import com.hzlh.service.ICompanyProductService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CompanyProductServiceImpl implements ICompanyProductService {
    @Resource
    TCompanyProductDao tCompanyProductDao;
    @Override
    public int deleteByPrimaryKey(Long id) {
        return tCompanyProductDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TCompanyProduct record) {
        return tCompanyProductDao.insert(record);
    }

    @Override
    public int insertSelective(TCompanyProduct record) {
        return tCompanyProductDao.insertSelective(record);
    }

    @Override
    public TCompanyProduct selectByPrimaryKey(Long id) {
        return tCompanyProductDao.selectByPrimaryKey(id);
    }

    @Override
    public List<TCompanyProduct> selectList(Map<String, Object> param) {
        param = CollectionUtils.isEmpty(param)?new HashMap<>():param;
        return tCompanyProductDao.selectList(param);
    }

    @Override
    public int updateByPrimaryKeySelective(TCompanyProduct record) {
        return tCompanyProductDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TCompanyProduct record) {
        return tCompanyProductDao.updateByPrimaryKey(record);
    }
}
